﻿//-----------------------------------------------------------------------
// <copyright file="ViewState.cs" company="Sławomir Rosiek">
//     Copyright (c) Sławomir Rosiek. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Rosieks.Web.Flow.Metadata
{
    using System.Diagnostics;
    using System.Reflection;

    [DebuggerDisplay("{Name, nq} : View")]
    public partial class ViewState
    {
        private MethodInfo fetchDataMethodInfo;

        /// <summary>
        /// Initializes a new instance of the <see cref="T:ViewState"/> class.
        /// </summary>
        public ViewState()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:ViewState"/> class.
        /// </summary>
        /// <param name="name">The name of the state.</param>
        public ViewState(string name)
        {
            this.Name = name;
        }

        //public override IExecutionObject OnAction(string actionName, ControllerContext context)
        //{
        //    if (string.IsNullOrEmpty(actionName))
        //    {
        //        if (!string.IsNullOrEmpty(this.FetchDataMethod))
        //        {
        //            context.Controller.ViewData.Model = this.InvokeFetchDataMethod(context);
        //        }

        //        return this;
        //    }
        //    else
        //    {
        //        return base.OnAction(actionName, context);
        //    }
        //}
    }
}
